<template>
  <div class="defineIndex">
    <userHeader/>

    <div class="breadClum">
      <span>
          <router-link :to="{path:'/pageIndex'}">   <a class="bread1">当前位置：首页  >  </a></router-link>
          <router-link :to="{path:'/progressTest'}">  <a class="bread2">评价流程 ></a></router-link>
          <router-link :to="{path:'/comment'}">  <a class="bread2">内控评价 ></a></router-link>
          <a class="bread2">评价及缺陷认定审核 </a>
      </span>
    </div>
    <!--:rules="rules"-->
    <div class="loading" v-if="!form.inspection_method">正在加载...</div>
    <el-form ref="form" :model="form" :rules="rules" v-else>
      <!-- 第一部分:头部 -->
      <div class="e-con-form">
        <h3 class="e-con-h3">
          《{{form.info.process_name}}》评价及缺陷认定
          <span class="see-info" @click='viewBasicInformation'>查看基本信息</span>
        </h3>
        <!--展示基本信息的弹出层-->
        <el-dialog
          title="基本信息"
          :visible.sync="showBasicInformation"
          width="800px"
          center>
          <div class="basic-information-content">
            <el-row>
              <el-col :span="12">
                <el-row>
                  <el-col :span="8" style="text-align: right;padding-right:8px;box-sizing: border-box;">评价单位:</el-col>
                  <el-col :span="16" style="text-align: left;">{{basicInformation.company_name}}</el-col>
                </el-row>
              </el-col>
              <el-col :span="12">
                <el-row>
                  <el-col :span="8" style="text-align: right;padding-right:8px;box-sizing: border-box;">评价期间:</el-col>
                  <el-col :span="16" style="text-align: left;">{{basicInformation.duringEvaluation}}</el-col>
                </el-row>
              </el-col>

              <el-col :span="12">
                <el-row>
                  <el-col :span="8" style="text-align: right;padding-right:8px;box-sizing: border-box;">流程名称:</el-col>
                  <el-col :span="16" style="text-align: left;">{{basicInformation.process_name}}</el-col>
                </el-row>
              </el-col>
              <el-col :span="12">
                <el-row>
                  <el-col :span="8" style="text-align: right;padding-right:8px;box-sizing: border-box;">评价项目:</el-col>
                  <el-col :span="16" style="text-align: left;">{{basicInformation.evaplan_type_name}}</el-col>
                </el-row>
              </el-col>

              <el-col :span="12">
                <el-row>
                  <el-col :span="8" style="text-align: right;padding-right:8px;box-sizing: border-box;">项目代码:</el-col>
                  <el-col :span="16" style="text-align: left;">{{basicInformation.process_num}}</el-col>
                </el-row>
              </el-col>
              <el-col :span="12">
                <el-row>
                  <el-col :span="8" style="text-align: right;padding-right:8px;box-sizing: border-box;">要求完成时间:</el-col>
                  <el-col :span="16" style="text-align: left;">{{basicInformation.evaluation_finishtime}}</el-col>
                </el-row>
              </el-col>

              <el-col :span="12">
                <el-row>
                  <el-col :span="8" style="text-align: right;padding-right:8px;box-sizing: border-box;">评价人员:</el-col>
                  <el-col :span="16" style="text-align: left;">{{basicInformation.evaluator_name}}</el-col>
                </el-row>
              </el-col>

              <el-col :span="12">
                <el-row>
                  <el-col :span="8" style="text-align: right;padding-right:8px;box-sizing: border-box;">审核人员:</el-col>
                  <el-col :span="16" style="text-align: left;">{{basicInformation.auditor_name}}</el-col>
                </el-row>
              </el-col>

            </el-row>
          </div>
        </el-dialog>
      </div>
      <div class="form-content">
        <!-- 第一部分:设计评价 -->
        <div class="e-con-form design-evaluate evaluate-content">
          <h3 class="evaluate-content-title">
            <span>1</span>设计评价
          </h3>
          <el-row class="design-evaluate-item">
            <el-col :span="24">
              <el-form-item label="评价标准" prop="evaluation_criterion" label-width="12.5%">
                <el-input readonly type="textarea" v-model="form.evaluation_criterion"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="制度内容" label-width="12.5%" prop="design-content">
                <el-row class="design-content">
                  <el-col v-for='(item,index) in form.system_content' :key='index' style="margin-bottom: 12px;">
                    <el-form-item :label="'制度'+(index+1)" label-width="12.5%" :prop="item.name">
                      <el-row>
                        <el-col :span="22">
                          <el-input
                            placeholder="制度名称"
                            v-model="item.name"
                            @dblclick.native="copyContent"
                            clearable
                            style="margin-bottom:4px;">
                          </el-input>
                          <el-input
                            type="textarea"
                            :rows="2"
                            placeholder="制度内容"
                            v-model="item.content">
                          </el-input>
                        </el-col>
                        <el-col :span="2" style="font-size:20px;color:#5d9120;cursor:pointer;text-align: center;"
                                v-if="index!=0">
                          <i class="el-icon-circle-close-outline" @click="deleteSystemContent(index)"></i>
                        </el-col>
                      </el-row>

                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="24">
                    <el-button class="add-design-content" @click='addDesignContent' type="primary">添加<i
                      class="el-icon-plus el-icon--right"></i></el-button>
                  </el-col>
                </el-row>
              </el-form-item>
            </el-col>
            <el-col>
              <el-form-item label="缺陷标识" prop="design_defect.design_defect_identify" label-width="12.5%">
                <el-radio-group v-model="form.design_defect.design_defect_identify"
                                @change="designDefectIdentifyChange">
                  <el-radio label="0">有</el-radio>
                  <el-radio label="1">无</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col>
              <el-row>
                <el-col :span="4">
                  <el-form-item label="标准分值" label-width="74.5%">
                    <el-tag style="backgroound-color:#deeecc;color:#5d9120;border-color:transparent;">
                      {{design_standard_score}}
                    </el-tag>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="扣分比例" prop="design_defect.design_defect_prop" label-width="25.5%"
                                :rules="[
                              { required: true, message: '请输入扣分比例', trigger: 'blur' },
                              { pattern: /^(\d){1,2}$/, message: '请输入1-100内的值', trigger: 'blur' }
                              ]">
                    <el-input v-model="form.design_defect.design_defect_prop"
                              :disabled="form.design_defect.design_defect_identify==1"
                              placeholder="请填写百分制，例如:20%->20"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="4">
                  <el-form-item label="设计评价分值" label-width="63.5%">
                    <el-tag style="backgroound-color:#deeecc;color:#5d9120;border-color:transparent;">
                      {{design_defect_score}}
                    </el-tag>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-col>
            <el-col>
              <el-form-item label="设计评价内容" prop="design_defect.design_defect_title" label-width="12.5%">
                <el-input
                  type="textarea"
                  :rows="6"
                  placeholder="设计评价内容"
                  v-model="form.design_defect.design_defect_title"
                  :disabled="form.design_defect.design_defect_identify==1">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </div>

        <!--制度内容的复制-->
        <el-dialog
          title="内控建设"
          :visible.sync="walk_through_Identification"
          @close="closeContentForm"
          width="680px">
          <el-form ref="contentForm" :model="contentForm" class="content_form">
            <el-row :gutter="20">
              <el-col :span="6">
                <el-form-item style="width:100%;">
                  <el-select style="width:100%;" v-model="contentForm.dacate_id" placeholder="多级分类" @change="searchContentByDacate_id">
                    <el-option :label="item.dacate_name" :value="item.dacate_id" v-for="item in classificationTableList" :key="item.dacate_id"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="14">
                <el-form-item>
                  <el-input  v-model="contentForm.search_txt" style="width: 100%;" type="text" placeholder="关键字搜索"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="4">
                <el-form-item>
                  <el-button style="background:#f0b914;color:#fff;border-color:#f0b914; " @click="searchContentBySearch_txt">确定</el-button>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
          <el-table
            :data="contentForm.tableData"
            style="width: 100%">
            <el-table-column
              type="index"
              label="序号"
              width="60">
            </el-table-column>
            <el-table-column
              prop="datum_name"
              label="文件名称"
              width="388px">
            </el-table-column>
            <el-table-column
              prop="address"
              label="操作">
              <template slot-scope="scope">
                <a :href="scope.row.datum_link" target="_blank" style="color:rgb(59, 111, 195)">查看</a>
              </template>
            </el-table-column>
            <el-table-column></el-table-column>
          </el-table>
        </el-dialog>

        <!-- 第二部分：执行评价 -->
        <div class='e-con-form execute-evaluate evaluate-content'>
          <h3 class="evaluate-content-title">
            <span>2</span>执行评价
          </h3>
          <!--非穿行测试部分-->
          <div class="not-walk-through" v-if="form.walk_through==0">
            <el-row>
              <el-col :span="24">
                <el-form-item label="检查方法" prop="inspection_method" label-width="12.5%">
                  <el-input readonly type="textarea" v-model="form.inspection_method"></el-input>
                </el-form-item>
                <el-form-item label="控制证据" prop="control_evidence" label-width="12.5%">
                  <el-input readonly type="textarea" v-model="form.control_evidence"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <div class="convertToImage">
              <!-- 抽样检查记录表 -->
              <div class="execute-evaluate-item"
                   v-if="form.samplerecord && (form.inspection_mode == 1 ||form.inspection_mode == 4 ||form.inspection_mode == 5 ||form.inspection_mode == 7 ||form.inspection_mode == 8)">
                <h3 class="execute-evaluate-item-thead">
                  <el-row :gutter="14">
                    <el-col :span="19">
                      <div>抽样检查记录表</div>
                    </el-col>
                    <el-col :span="2">
                      <div>
                        <el-button type="primary" icon="el-icon-plus" @click="addSample"
                                   v-show="(parseFloat(form.samplerecord.overall_scale)>0 ) && this.role !=2 && this.form.evaluation_state !=2">
                          样本
                        </el-button>
                      </div>
                    </el-col>
                    <el-col :span="3">
                      <div>
                        <el-button type="primary" icon="el-icon-plus" @click="addSampleMaintain"
                                   v-show="((parseFloat(form.samplerecord.overall_scale)>0) && this.role !=2) && this.form.evaluation_state !=2">
                          检查内容
                        </el-button>
                      </div>
                    </el-col>
                  </el-row>
                </h3>
                <!--添加检查内容 el-dialog-->
                <el-dialog
                  title="添加检查内容"
                  :visible.sync="addSampleContent"
                  width="600px"
                  center>
                  <div class="el-dialog-content">
                    <el-form :model="sampleContentForm" ref="sampleContentForm">
                      <div style="margin-bottom: 10px;height:40px;line-height:40px;">
                        <span>设计检查表</span>
                        <el-button style="float: right" type="warning" icon="el-icon-plus" @click="addCleckItem">添加检查项
                        </el-button>
                      </div>
                      <el-table
                        :data="sampleContentForm.company_samplemaintain"
                        stripe
                        border>
                        <el-table-column
                          type="index"
                          label="检查项"
                          width="80">
                        </el-table-column>
                        <el-table-column
                          label="描述">
                          <template slot-scope="scope">
                            <el-form-item style="margin-bottom:0;width:100%">
                              <el-input type="textarea" :row="1" v-model="scope.row.samplemaintain_desc"
                                        style="width:100%"></el-input>
                            </el-form-item>
                          </template>
                        </el-table-column>
                        <el-table-column
                          label="操作"
                          width="100">
                          <template slot-scope="scope">
                            <el-button type="danger" @click="deleteCheckItem(scope.row.cosn_id)">删除</el-button>
                          </template>
                        </el-table-column>
                      </el-table>
                      <el-form-item style="text-align: right;margin-top:20px;">
                        <el-button @click="cancelSampleContentAdd('sampleContentForm')">取消</el-button>
                        <el-button type="primary" @click="sureSampleContentAdd('sampleContentForm')">提交</el-button>
                      </el-form-item>
                    </el-form>
                  </div>
                </el-dialog>
                <div class="execute-evaluate-item-body">
                  <!--<span>{{sampleState}}</span>-->
                  <!--<div class="execute-evaluate-item-body-mask" v-if="sampleState==2"></div>-->
                  <el-row :gutter="14">
                    <el-col :span="24">
                      <el-form-item label="样本总量确定方法" label-width="12.5%">
                        <el-select v-model="form.samplerecord.samplemethod_id" placeholder="请选择" style="width:100%;">
                          <el-option
                            v-for="item in form.samplemethod"
                            :key="item.value"
                            :label="item.name"
                            :value="item.value">
                          </el-option>
                        </el-select>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="14">
                    <el-col :span="12">
                      <el-form-item label="总体规模" prop="samplerecord.overall_scale" label-width="25.5%" :rules="[
                                  { required: true, message: '请输入总体规模', trigger: 'blur' },
                                  { pattern: /^(\d)+$/, message: '请输入正整数', trigger: 'blur' }
                                  ]">
                        <el-input v-model="form.samplerecord.overall_scale" placeholder="请先选择样本总量确定方法"
                                  :disabled="(!form.samplerecord.samplemethod_id)"
                                  @keyup.native="overallScaleBlur"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="抽样数量" prop="sample_size" label-width="25.5%">
                        <el-tag style="backgroound-color:#deeecc;color:#5d9120;border-color:transparent;">{{sample_size}}
                        </el-tag>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <!--样本为非零 抽样-->
                  <!--parseInt(form.samplerecord.overall_scale)!= 0-->
                  <el-row v-if="!!form.samplerecord.overall_scale && parseInt(form.samplerecord.overall_scale)!= 0">
                    <el-table
                      :data="form.samplerecord.list"
                      stripe
                      border
                      max-width="100%"
                      v-if="">
                      <el-table-column
                        type="index"
                        label="序号"
                        width="60">
                      </el-table-column>
                      <el-table-column
                        label="日期"
                        width="180">
                        <template slot-scope="scope">
                          <el-form-item style="margin-bottom:0">
                            <el-date-picker
                              v-model="scope.row.sample_time"
                              type="date"
                              placeholder="选择日期"
                              :picker-options="pickerOptions"
                              style="width:100%;">
                            </el-date-picker>
                          </el-form-item>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="样本名称"
                        width="180">
                        <template slot-scope="scope">
                          <el-form-item style="margin-bottom:0">
                            <el-input v-model="scope.row.sample_name"></el-input>
                          </el-form-item>
                        </template>
                      </el-table-column>
                      <!--模板检查内容-->
                      <el-table-column
                        v-for="(col,index) in form.samplemaintain"
                        :label="col.name" :key="col.prop">
                        <template slot-scope="scope">
                          <el-form-item prop="InspectionContentsList" style="margin-bottom:0">
                            <el-select v-model="scope.row.inspection_contents[index].name"
                                       style="margin-left:0">
                              <el-option v-for="item in form.samplemaintain_state" :key="item.name" :value="item.name"
                                         :label="item.state">{{item.name}}
                              </el-option>
                            </el-select>
                          </el-form-item>
                        </template>
                      </el-table-column>
                      <!--公司检查内容-->
                      <!--v-if="form.samplerecord.list[0].com_inspection_contents.length>0"-->
                      <el-table-column
                        v-for="(col,index) in form.company_samplemaintain"
                        :label="col.name" :key="col.prop">
                        <template slot-scope="scope">
                          <el-form-item prop="companyInspectionContentsList" style="margin-bottom:0">
                            <el-select v-model="scope.row.com_inspection_contents[index].name"
                                       style="margin-left:0">
                              <el-option v-for="item in form.samplemaintain_state" :key="item.name" :value="item.value">
                                {{item.name}}
                              </el-option>
                            </el-select>
                          </el-form-item>
                        </template>
                      </el-table-column>
                      <el-table-column
                        prop="inspection_conclusion"
                        label="检查结论">
                        <template slot-scope="scope">
                          <el-form-item style="margin-bottom:0">
                            <el-input v-model="scope.row.inspection_conclusion"></el-input>
                          </el-form-item>
                        </template>
                      </el-table-column>
                      <el-table-column
                        prop="inspection_conclusion"
                        label="附件"
                        width="120">
                        <template slot-scope="scope">
                          <!--v-if="scope.row.file_id"-->
                          <el-upload
                            class='image-uploader'
                            list-type='text'
                            :limit="1"
                            name="up_file"
                            action="/api/v1/flow/uploadedfile"
                            :headers="headers"
                            :on-success=" (res,file,filelist)=>{ return uploadSuccess(res,file,filelist,scope.$index)}"
                            :show-file-list=false>
                            <span style="background: #8cc34b;color: #fff;padding: 7px 7px;box-sizing: border-box;"><i class="el-icon-upload el-icon--right"></i>上传附件</span>
                          </el-upload>
                          <a style="color:#666;" :href="scope.row.attachment_link" v-if="scope.row.file_id">{{scope.row.file_name}}</a>
                          <!--:on-success="uploadSuccess"-->
                        </template>
                      </el-table-column>
                      <el-table-column
                        prop="inspection_conclusion"
                        label="操作"
                        width="120">
                        <template slot-scope="scope">
                          <a href="#" style="color:#5d9120" @click="deleteSampleItem(scope.$index)">删除</a>
                        </template>
                      </el-table-column>
                    </el-table>
                  </el-row>

                  <!--样本为零 抽样-->
                  <el-row style="border-top:1px solid #8cc34b;padding-top:20px;"
                          v-if="(form.samplerecord.overall_scale==0) && form.sample0record">
                    <el-col :span="12">
                      <el-form-item label="样本总量为0原因" prop="sample0record.sample_0_reason" label-width="25.5%">
                        <el-radio-group v-model="form.sample0record.sample_0_reason">
                          <el-radio label="1">当期未发生</el-radio>
                          <el-radio label="2">未形成记录</el-radio>
                        </el-radio-group>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="应形成样本名称" label-width="25.5%">
                        <el-tag type="info">{{form.should_form_sample_name}}</el-tag>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="未形成记录原因" prop="sample0record.no_record_reason" label-width="25.5%"
                                    v-if="this.form.sample0record.sample_0_reason==2">
                        <el-input v-model="form.sample0record.no_record_reason"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col style="text-align: right;" v-if="sampleState!=1">
                      <!--清空数据  重置-->
                      <el-button type="info" plain @click="form.samplerecord.overall_scale=''">重置</el-button>
                      <el-button type="primary" @click="onSubmitSample0Record('form')">确定</el-button>
                    </el-col>
                  </el-row>
                </div>
              </div>

              <!-- 现场检查记录表 -->
              <div class="execute-evaluate-item"
                   v-if="sceneinspectrecordIsExist">
                <h3 class="execute-evaluate-item-thead">
                  <el-row :gutter="14">
                    <el-col>
                      <div>现场检查记录表</div>
                    </el-col>
                  </el-row>
                </h3>
                <div class="execute-evaluate-item-body">
                  <el-row :gutter="14">
                    <el-col :span="24">
                      <!--prop="sceneinspectrecord.inspect_time"-->
                      <el-form-item label="现场检查时间" :rules="[
                                  { required: true, message: '请选择现场检查时间', trigger: 'blur' }]" label-width="12.5%">
                        <el-date-picker
                          v-model="form.sceneinspectrecord.inspect_time"
                          type="date"
                          placeholder="选择日期"
                          :picker-options="pickerOptions">
                        </el-date-picker>
                      </el-form-item>
                    </el-col>
                    <el-col :span="24">
                      <!--prop="sceneinspectrecord.inspect_address"-->
                      <el-form-item label="检查地点" :rules="[
                                  { required: true, message: '请输入检查地点', trigger: 'blur' }]" label-width="12.5%">
                        <el-input type="text" placeholder="请输入检查地点" v-model="form.sceneinspectrecord.inspect_address">
                        </el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="24">
                      <!--prop="sceneinspectrecord.inspect_personnel"-->
                      <el-form-item label="检查人员" :rules="[
                                  { required: true, message: '请输入检查人员', trigger: 'blur' }]" label-width="12.5%">
                        <el-input type="text" placeholder="请输入检查人员" v-model="form.sceneinspectrecord.inspect_personnel">
                        </el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="24">
                      <!--prop="sceneinspectrecord.inspect_record"-->
                      <el-form-item label="检查记录" :rules="[
                                  { required: true, message: '请认真输入检查记录', trigger: 'blur' }]" label-width="12.5%">
                        <el-input
                          type="textarea"
                          :rows="4"
                          placeholder="请输入内容"
                          v-model="form.sceneinspectrecord.inspect_record">
                        </el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>
                </div>
              </div>

              <!-- 访谈记录表 -->
              <div class="execute-evaluate-item"
                   v-if="interviewsrecordIsExist">
                <h3 class="execute-evaluate-item-thead">
                  <el-row :gutter="14">
                    <el-col>
                      <div>访谈记录表</div>
                    </el-col>
                  </el-row>
                </h3>
                <div class="execute-evaluate-item-body" v-for="(item,index) in form.interviewsrecord" :key="index">
                  <el-row :gutter="14">
                    <el-col>
                      <el-form-item label="被访谈人员" label-width="12.5%"
                                    :rules="[{ required: true, message: '请输入被访谈人员', trigger: 'blur' }]">
                        <el-input v-model="item.be_interviews_personnel" placeholder="请输入被访谈人员"></el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="14">
                    <el-col>
                      <el-form-item label="职位" label-width="12.5%"
                                    :rules="[{ required: true, message: '请输入被访谈人员职位', trigger: 'blur' }]">
                        <el-input v-model="item.be_interviews_position" placeholder="请输入职位" style="width: 32%;"></el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="14">
                    <el-col :span="12">
                      <el-form-item label="访谈时间" label-width="25.5%">
                        <el-date-picker
                          v-model="item.interviews_time"
                          type="date"
                          placeholder="选择日期"
                          :picker-options="pickerOptions">
                        </el-date-picker>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="访谈地点" label-width="12.5%">
                        <el-input v-model="item.interviews_address" placeholder="请输入访谈地点"></el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="14">
                    <el-col :span="12">
                      <el-form-item label="访谈人员" label-width="25.5%">
                        <el-input v-model="item.interviews_personnel" placeholder="请输入访谈人员"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="记录人员" label-width="12.5%">
                        <el-input v-model="item.record_personnel" placeholder="请输入记录人员"></el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col>
                      <el-form-item label="访谈内容" label-width="12.5%">
                        <el-input
                          type="textarea"
                          :rows="4"
                          placeholder="请输入内容"
                          v-model="item.interviews_content">
                        </el-input>
                      </el-form-item>
                    </el-col>
                    <el-col>
                      <el-form-item label="访谈记录" label-width="12.5%">
                        <el-input
                          type="textarea"
                          :rows="4"
                          placeholder="请输入内容"
                          v-model="item.interviews_record">
                        </el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row v-if="index!=0 && role!=2">
                    <el-button type="primary" style="width: 100%;" @click="deleteInterviewsrecord(index)">删除</el-button>
                  </el-row>
                </div>
                <el-row>
                  <el-button type="primary" style="width: 100%;margin-bottom:40px;" @click="addInterviewNotes" v-if="role!='2'">添加访谈记录<i
                    class="el-icon-plus el-icon--right"></i></el-button>
                </el-row>
              </div>
            </div>
            <!--执行评价 缺陷-->
            <!--v-if="(form.samplerecord !=null && parseInt(form.samplerecord.overall_scale)!=0) || (sampleState && sampleState == 1) "-->
            <div class="execute-container">
              <el-row>
                <el-col>
                  <el-form-item label="缺陷标识" prop="execute_defect.execute_defect_identify" label-width="12.5%">
                    <el-radio-group v-model="form.execute_defect.execute_defect_identify"
                                    @change="executeDefectIdentifyChange">
                      <el-radio label="0">有</el-radio>
                      <el-radio label="1" :disabled="form.sample0record!=null && form.sample0record.sample_0_reason==2 && sampleState==1">无</el-radio>
                    </el-radio-group>
                  </el-form-item>
                </el-col>
                <el-col>
                  <el-row>
                    <el-col :span="4">
                      <el-form-item label="标准分值" label-width="74.5%">
                        <el-tag style="backgroound-color:#deeecc;color:#5d9120;border-color:transparent;">
                          {{execute_standard_score}}
                        </el-tag>
                      </el-form-item>
                    </el-col>
                    <el-col :span="8">
                      <el-form-item label="扣分比例" prop="execute_defect.execute_defect_prop" :rules="[
                                { required: true, message: '请输入扣分比例', trigger: 'blur' },
                                { pattern: /^(\d){1,2}$/, message: '请输入1-100内的值', trigger: 'blur' }
                                ]" label-width="25.5%">
                        <el-input v-model="form.execute_defect.execute_defect_prop"
                                  :disabled="form.execute_defect.execute_defect_identify==1"
                                  placeholder="请填写百分制，例如:20%->20"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="4">
                      <el-form-item label="执行评价分值" label-width="63.5%">
                        <el-tag style="backgroound-color:#deeecc;color:#5d9120;border-color:transparent;"
                        >
                          {{execute_defect_score}}
                        </el-tag>
                      </el-form-item>
                    </el-col>
                  </el-row>
                </el-col>
                <el-col>
                  <el-form-item label="执行评价结论" prop="execute_defect.execute_defect_title" label-width="12.5%">
                    <el-input
                      type="textarea"
                      :rows="4"
                      placeholder="请输入执行评价结论"
                      v-model="form.execute_defect.execute_defect_title"
                      :disabled="form.execute_defect.execute_defect_identify==1">
                    </el-input>
                  </el-form-item>
                </el-col>
              </el-row>
            </div>
          </div>

          <!--穿行测试-->
          <div class="walk-through" v-if="form.walk_through!=0">
            <div class="convertToImage">
              <div class="execute-evaluate-item">
                <h3 class="execute-evaluate-item-thead">
                  <el-row :gutter="14">
                    <el-col>
                      <div>穿行测试记录表</div>
                    </el-col>
                  </el-row>
                </h3>
                <div class="execute-evaluate-item-body">
                  <el-row :gutter="14">
                    <el-col :span="24">
                      <el-form-item label="评价方法" label-width="12.5%">
                        <el-input readonly type="textarea" v-model="form.mergerecord.evaluation_method"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="24">
                      <el-form-item label="提供资料" label-width="12.5%">
                        <el-input readonly type="textarea" v-model="form.mergerecord.merge_template_needdatum"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="样本总量" label-width="25.5%">
                        <el-input type="text" v-model="form.mergerecord.sample_total" @blur="mergeSampleTotal"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="样本数量" label-width="12.5%">
                        <el-tag>{{form.mergerecord.sample_size || 0}}</el-tag>
                      </el-form-item>
                    </el-col>
                    <el-row v-if ="form.mergerecord.sample_size">
                      <el-col :span="24" v-if="form.mergerecord.sample_size==1">
                        <el-form-item :label="form.mergerecord.sample_name + '一'" label-width="12.5%" :rules="[
                              { required: true, message: '请输入内容', trigger: 'blur' }]">
                          <el-input v-model="form.mergerecord.sample_1"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="24" v-if="form.mergerecord.sample_size==2">
                        <el-form-item :label="form.mergerecord.sample_name + '一'" label-width="12.5%" :rules="[
                              { required: true, message: '请输入内容', trigger: 'blur' }]">
                          <el-input v-model="form.mergerecord.sample_1"></el-input>
                        </el-form-item>
                        <el-form-item :label="form.mergerecord.sample_name + '二'" label-width="12.5%" :rules="[
                              { required: true, message: '请输入内容', trigger: 'blur' }]">
                          <el-input v-model="form.mergerecord.sample_2"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="24" v-if="form.mergerecord.sample_size==3">
                        <el-form-item :label="form.mergerecord.sample_name + '一'" label-width="12.5%" :rules="[
                              { required: true, message: '请输入内容', trigger: 'blur' }]">
                          <el-input v-model="form.mergerecord.sample_1"></el-input>
                        </el-form-item>
                        <el-form-item :label="form.mergerecord.sample_name + '二'" label-width="12.5%" :rules="[
                              { required: true, message: '请输入内容', trigger: 'blur' }]">
                          <el-input v-model="form.mergerecord.sample_2"></el-input>
                        </el-form-item>
                        <el-form-item :label="form.mergerecord.sample_name + '三'" label-width="12.5%" :rules="[
                              { required: true, message: '请输入内容', trigger: 'blur' }]">
                          <el-input v-model="form.mergerecord.sample_3"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="24" v-if="form.mergerecord.sample_size==4">
                        <el-form-item :label="form.mergerecord.sample_name + '一'" label-width="12.5%" :rules="[
                              { required: true, message: '请输入内容', trigger: 'blur' }]">
                          <el-input v-model="form.mergerecord.sample_1"></el-input>
                        </el-form-item>
                        <el-form-item :label="form.mergerecord.sample_name + '二'" label-width="12.5%" :rules="[
                              { required: true, message: '请输入内容', trigger: 'blur' }]">
                          <el-input v-model="form.mergerecord.sample_2"></el-input>
                        </el-form-item>
                        <el-form-item :label="form.mergerecord.sample_name + '三'" label-width="12.5%" :rules="[
                              { required: true, message: '请输入内容', trigger: 'blur' }]">
                          <el-input v-model="form.mergerecord.sample_3"></el-input>
                        </el-form-item>
                        <el-form-item :label="form.mergerecord.sample_name + '四'"  label-width="12.5%" :rules="[
                              { required: true, message: '请输入内容', trigger: 'blur' }]">
                          <el-input v-model="form.mergerecord.sample_4"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="24" v-if="form.mergerecord.sample_size==5">
                        <el-form-item :label="form.mergerecord.sample_name + '一'"  label-width="12.5%" :rules="[
                              { required: true, message: '请输入内容', trigger: 'blur' }]">
                          <el-input v-model="form.mergerecord.sample_1"></el-input>
                        </el-form-item>
                        <el-form-item :label="form.mergerecord.sample_name + '二'" label-width="12.5%" :rules="[
                              { required: true, message: '请输入内容', trigger: 'blur' }]">
                          <el-input v-model="form.mergerecord.sample_2"></el-input>
                        </el-form-item>
                        <el-form-item :label="form.mergerecord.sample_name + '三'" label-width="12.5%" :rules="[
                              { required: true, message: '请输入内容', trigger: 'blur' }]">
                          <el-input v-model="form.mergerecord.sample_3"></el-input>
                        </el-form-item>
                        <el-form-item :label="form.mergerecord.sample_name + '四'" label-width="12.5%" :rules="[
                              { required: true, message: '请输入内容', trigger: 'blur' }]">
                          <el-input v-model="form.mergerecord.sample_4"></el-input>
                        </el-form-item>
                        <el-form-item :label="form.mergerecord.sample_name + '五'" label-width="12.5%" :rules="[
                              { required: true, message: '请输入内容', trigger: 'blur' }]">
                          <el-input v-model="form.mergerecord.sample_5"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                  </el-row>

                  <el-row>
                    <el-table
                      :data="form.mergerecord.list"
                      stripe
                      style="width: 100%">
                      <el-table-column
                        type="index"
                        label="序号"
                        width="80">
                      </el-table-column>
                      <el-table-column
                        prop="mergecourse_content"
                        label="穿行测试过程"
                        width="180">
                      </el-table-column>
                      <el-table-column
                        prop="mere_data_result"
                        label="结果"
                        width="180">
                        <template slot-scope="scope">
                          <el-input v-model="scope.row.mere_data_result" placeholder="请输入内容"></el-input>
                        </template>
                      </el-table-column>
                      <el-table-column
                        prop="mergecourse_needdatum"
                        label="需取得资料"
                        width="180">
                      </el-table-column>
                      <el-table-column
                        prop="name"
                        label="电子/纸质"
                        width="120">
                        <template slot-scope="scope">
                          <el-select v-model="scope.row.mere_data_type" placeholder="请选择">
                            <el-option v-for="(item,index) in form.mere_data_type_list" :label="item.name" :value="item.value" :key="index"></el-option>
                          </el-select>
                        </template>
                      </el-table-column>
                      <el-table-column
                        prop="name"
                        label="文件上传">
                        <template slot-scope="scope">
                          <el-upload
                            class='image-uploader'
                            list-type='text'
                            :limit="1"
                            name="up_file"
                            action="/api/v1/flow/uploadedfile"
                            :headers="headers"
                            :on-success=" (res,file,filelist)=>{ return uploadSuccess(res,file,filelist,scope.$index)}"
                            :show-file-list=false>
                            <!--<el-tag><i class="el-icon-upload el-icon&#45;&#45;right"></i>上传附件</el-tag>-->
                            <span style="background: #8cc34b;color: #fff;padding: 7px 7px;box-sizing: border-box;"><i class="el-icon-upload el-icon--right"></i>上传附件</span>
                          </el-upload>
                          <a :href="scope.row.attachment_link" v-if="scope.row.file_id">{{scope.row.file_name}}</a>
                        </template>
                      </el-table-column>
                      <el-table-column
                        prop="address"
                        label="评价结论">
                        <template slot-scope="scope">
                          <el-input type="textarea" v-model="scope.row.mere_data_contents" placeholder="请输入内容"></el-input>
                        </template>
                      </el-table-column>
                      <el-table-column></el-table-column>
                    </el-table>
                  </el-row>
                </div>
              </div>
              <el-row>
                <div class="execute-container">
                  <el-row>
                    <el-col>
                      <el-form-item label="缺陷标识" prop="execute_defect.execute_defect_identify" label-width="12.5%">
                        <el-radio-group v-model="form.execute_defect.execute_defect_identify"
                                        @change="executeDefectIdentifyChange">
                          <el-radio label="0">有</el-radio>
                          <el-radio label="1" :disabled="form.sample0record!=null && form.sample0record.sample_0_reason==2 && sampleState==1">无</el-radio>
                        </el-radio-group>
                      </el-form-item>
                    </el-col>
                    <el-col>
                      <el-row>
                        <el-col :span="4">
                          <el-form-item label="标准分值" label-width="74.5%">
                            <el-tag style="backgroound-color:#deeecc;color:#5d9120;border-color:transparent;">
                              {{execute_standard_score}}
                            </el-tag>
                          </el-form-item>
                        </el-col>
                        <el-col :span="8">
                          <el-form-item label="扣分比例" prop="execute_defect.execute_defect_prop" :rules="[
                                { required: true, message: '请输入扣分比例', trigger: 'blur' },
                                { pattern: /^(\d){1,2}$/, message: '请输入1-100内的值', trigger: 'blur' }
                                ]" label-width="25.5%">
                            <el-input v-model="form.execute_defect.execute_defect_prop"
                                      :disabled="form.execute_defect.execute_defect_identify==1"
                                      placeholder="请填写百分制，例如:20%->20"></el-input>
                          </el-form-item>
                        </el-col>
                        <el-col :span="4">
                          <el-form-item label="执行评价分值" label-width="63.5%">
                            <el-tag style="backgroound-color:#deeecc;color:#5d9120;border-color:transparent;"
                            >
                              {{execute_defect_score}}
                            </el-tag>
                          </el-form-item>
                        </el-col>
                      </el-row>
                    </el-col>
                    <el-col>
                      <el-form-item label="执行评价结论" prop="execute_defect.execute_defect_title" label-width="12.5%">
                        <el-input
                          type="textarea"
                          :rows="4"
                          placeholder="请输入执行评价结论"
                          v-model="form.execute_defect.execute_defect_title"
                          :disabled="form.execute_defect.execute_defect_identify==1">
                        </el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>
                </div>
              </el-row>
            </div>
          </div>

        </div>

        <!-- 第三部分:历年缺陷 -->
        <div class="e-con-form defect-identification evaluate-content">
          <h3 class="evaluate-content-title">
            <span>3</span>上期缺陷
          </h3>
          <el-row class="defect-identification-item" v-if="previousDefects">
            <el-col :span="12">
              <el-form-item label="上年缺陷标识" prop="" label-width="25.5%">
                <el-tag style="backgroound-color:#deeecc;color:#5d9120;border-color:transparent;">无</el-tag>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="上年整改状态" prop="" label-width="25.5%">
                <el-tag style="backgroound-color:#deeecc;color:#5d9120;border-color:transparent;">无</el-tag>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="上年评价结论" prop="" label-width="12.5%">
                <el-input
                  type="textarea"
                  :rows="3"
                  placeholder="请输入内容"
                  v-model="textarea">
                </el-input>
              </el-form-item>
            </el-col>
            <el-col>
              <el-form-item label="缺陷是否相同" prop="defect_identification" required="" label-width="12.5%">
                <el-radio v-model="form.defectIdentification" label="1">是</el-radio>
                <el-radio v-model="form.defectIdentification" label="2">否</el-radio>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row v-else>
            <el-col style="text-align: center;font-size:14px;color:#606266;">暂无上期数据</el-col>
          </el-row>
        </div>

        <!-- 第四部分:缺陷类型认定 -->
        <!--v-if="form.design_defect_identify=='0' || form.execute_defect_identify=='0'"-->
        <div class="e-con-form defect-confirm evaluate-content"
             v-if="defectrectificationIsExist">
          <h3 class="evaluate-content-title">
            <span>4</span>缺陷类型认定
          </h3>
          <el-row class="defect-confirm-item">
            <el-col>
              <el-form-item label="缺陷描述"  label-width="12.5%">
                <el-input
                  type="textarea"
                  readonly
                  :rows="4"
                  placeholder="请输入内容"
                  v-model="defect_describe">
                </el-input>
              </el-form-item>
            </el-col>
            <el-col>
              <el-form-item label="表现形式" prop="performance_form" label-width="12.5%">
                <el-select v-model="form.defectrectification.performance_form" placeholder="请选择" style="width: 100%;"
                           @change="performanceFormChange">
                  <el-option
                    v-for="item in form.performance_form"
                    :key="item.value"
                    :label="item.name"
                    :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="认定方式" prop="identification_method" label-width="25.5%">
                <el-select v-model="form.defectrectification.identification_method" placeholder="请选择"
                           style="width: 100%;"
                           @change="identificationMethodChange">
                  <el-option
                    v-for="item in form.identification_method"
                    :key="item.value"
                    :label="item.name"
                    :value="item.value"
                    :disabled="item.selected">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="指标" prop="defect_quota" label-width="25.5%">
                <el-select v-model="form.defectrectification.defect_quota" placeholder="请选择" style="width: 100%;">
                  <el-option
                    v-for="item in form.defect_quota"
                    :key="item.value"
                    :label="item.name"
                    :value="item.value"
                    :disabled="item.selected">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="因素" prop="factor" label-width="25.5%">
                <el-select v-model="form.defectrectification.factor" placeholder="请选择" style="width: 100%;"
                           @change="factorChange">
                  <el-option
                    v-for="item in form.factor"
                    :key="item.value"
                    :label="item.name"
                    :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="缺陷性质" prop="defect_identification" label-width="25.5%">
                <!--<span>hello{{form.defectrectification.defect_property}}</span>-->
                <el-tag style="backgroound-color:#deeecc;color:#5d9120;border-color:transparent;">
                  {{form.defectrectification.defect_property=="3"?"重大缺陷":form.defectrectification.defect_property=="2"?"重要缺陷":form.defectrectification.defect_property=="1"
                  ?"一般缺陷":""}}
                </el-tag>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="责任部门" prop="section_list" label-width="12.5%">
                <el-select v-model="form.defectrectification.section_id" multiple placeholder="请选择"><!---->
                  <el-option
                    v-for="item in form.section_list"
                    :key="item.value"
                    :label="item.name"
                    :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <!--prop="defectrectification.defect_impact_results"-->
              <el-form-item label="缺陷影响结果"  label-width="12.5%">
                <el-input
                  type="textarea"
                  :rows="4"
                  placeholder="请输入内容"
                  v-model="form.defectrectification.defect_impact_results">
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <!--prop="defectrectification.suggestions_improvement"-->
              <el-form-item label="改进建议" label-width="12.5%">
                <el-input
                  type="textarea"
                  :rows="4"
                  placeholder="请输入内容"
                  v-model="form.defectrectification.suggestions_improvement">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
        <!--<div class="form-content-mask" v-if="role==2 ||(this.form.evaluation_state ==1 && this.sampleState!=1 && this.sampleState!=2)" @click="maskWork"></div>-->
      </div>
      <!--审核标识-->
      <div class="e-con-form audit-identification" v-if="role == 2">
        <el-row>
          <el-col>
            <!--prop="auditing.evaluation_state"-->
            <el-form-item label="审核标识" :rules="[{ required: true, message: '请选择缺陷是否相同', trigger: 'blur' }]"
                          label-width="12.5%">
              <el-radio-group v-model="form.auditing.evaluation_state">
                <el-radio label="2">是</el-radio>
                <el-radio label="3">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <!--prop="auditing.auditing_view"-->
          <el-col :span="24">
            <el-form-item label="审核意见" :rules="[{ required: true, message: '请认真填写审核意见', trigger: 'blur' }]"
                          label-width="12.5%">
              <el-input
                type="textarea"
                :rows="4"
                placeholder="请输入内容"
                v-model="form.auditing.auditing_view">
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <!-- 提交按钮 -->
      <div class="e-con-form e-form-submit defect-audit">
        <!--评价提交-->
        <el-form-item
          v-if="isSaveOrSubmit && this.role ==1">
          <el-button class="
" @click.stop="onSubmitEvaluate('form',{submit_type:0})">保存</el-button>
          <el-button type="primary" @click="onSubmitEvaluate('form',{submit_type:1})" class="e-confirm">提交</el-button>
        </el-form-item>
        <el-form-item
          v-if="!isSaveOrSubmit && this.role ==1">
          <el-button type="info" @click.stop="disabledSubmit">保存</el-button>
          <el-button type="info" @click.stop="disabledSubmit" class="e-confirm">提交</el-button>
        </el-form-item>
        <!--审核提交-->
        <el-form-item v-if="this.form.evaluation_state !==0 && this.role ==2">
          <el-button type="primary" @click="onSubmitEvaluate('form',{submit_type:3})" class="e-confirm">提交</el-button>
        </el-form-item>
      </div>
    </el-form>

    <!-- 底部右下角 -->
    <fixed/>
  </div>
</template>
<script>
  import {mapState} from "vuex";
  import fixed from "@/components/fixed.vue";
  import userHeader from "@/components/header.vue";
  import {formatDateTime, formatTimeIncludeText} from "@/utils/index.js";
  //表单数据 及校验规则
  import {
    defectAuditRules,
    formData
  } from "@/utils/defectAuditFormDataAndRules.js";
  import {
    strToHexCharCode,
    toFixedBit,
    dec2hex,
    formatTime,
    getNewDate
  } from "@/utils/index.js";
  import {treeToArraysDacate} from '@/page/test/catalog.js'

  import html2canvas from 'html2canvas';

  var mdSecret = "fangyou968123456";

  export default {
    data() {
      return {
        totalMessage:[],
        totalOaMessage:[],
        walk_through_Identification:false,//制度内容的复制
        contentForm:{
          tableData:[],
          dacate_id:'',
          search_txt:''
        },//制度内容弹窗部分的表单
        walkThroughTable:[],//穿行测试的基本数据
        evaluation_state: "",
        role: '', //标记进来的用户是评价人员还是审核人员
        upLoadData: {},
        headers: {},
        showBasicInformation: false, //查看基本信息开关
        basicInformation: {
          duringEvaluation: ""
        }, //基本信息
        sampleContentForm: {
          //公司样本信息
          company_samplemaintain: []
        },
        sampleState: '',//样本为零状态
        sampleTotalCount: true, //样本总量 可否操作 标识
        previousDefects: false, //上期缺陷标识  现在没做 后期要换 20181226
        addSampleContent: false,
        form: formData,
        rules: defectAuditRules,
        pickerOptions: {
          //日期限定今天之前
          disabledDate(time) {
            return time.getTime() > Date.now();
          }
        },
        classificationList:[],
        merge_template_sample_list:['','','','','']
      };
    },

    components: {
      fixed,
      userHeader
    },
    computed: {
      ...mapState({
        user_id: state =>
        state.app.loginState.user_id || sessionStorage.getItem("user_id")
      }),
      mergerecordSample_size(){
        var arr =['sample_1','sample_2','sample_3','sample_4','sample_5'];
        if(this.form.mergerecord.sample_size){
          return arr.splice(0, this.form.mergerecord.sample_size)
        }
      },
      isSaveOrSubmit(){
        /**
         * 显示 保存 和 提交按钮的条件
         * 1.角色是评价人员
         * 2.评价计划状态 为零  样本为零状态 也为零
         * 2.样本状态为0 并且 样本数量不为零*/
        if(this.role == 1){
          console.log(1111)
          if(this.form.evaluation_state ==0){
            console.log(222)
            //非穿行测试
            if(this.form.walk_through == 0){
              console.log(444)
              // this.sampleState  bl_sample0record_state 样本为0的评价点是否已经审核  0:待审核 1:审核通过 2:审核未通过,  根据参数是否存在可判断是否有样本为0
              //当 走样本为零时  切评价状态为零时  不显示提交和保存按钮
              if(this.sampleState && this.sampleState ==2 ){
                if(this.form.samplerecord.overall_scale==0){
                  return false
                }else{
                  return true
                }
              }


              if(!this.sampleState && this.form.samplerecord && this.form.samplerecord.overall_scale===0){
                return false
              }
              return true
              //穿行测试
            }else {
              return true
            }
          }else {
            console.log(3333)
            return false
          }
        }else {
          return false
        }
      },
      //样本为零 未形成记录  审核通过  评价人员继续评价时 此时的执行评价一定是有缺陷 要做缺陷类型认定
      sample0recordState(){
        return this.form.sample0record!=null && this.form.sample0record.sample_0_reason==2 && this.sampleState==1
      },
      //分类列表  制度内容
      classificationTableList: function () {
        let tmp;
        console.log('XXXXXXXXXXXXXXXXXXXXXXXX')
        if (!Array.isArray(this.classificationList)) {
          tmp = [this.classificationList]
        } else {
          tmp = this.classificationList
        }
        const func = this.evalFunc || treeToArraysDacate
        // 'son_dacate'
        const args = this.evalArgs ? Array.concat([tmp, this.expandAll], this.evalArgs) : [tmp, this.expandAll]
        console.log(args)
        console.log(func.apply(null, args))
        return func.apply(null, args)
      },
      //现场记录表是否存在
      sceneinspectrecordIsExist() {
        var isExist = false;
        //只有在样本数量 非零  并且满足 inspection_mode 的情况 才返回true

        if(this.form.samplerecord!=null){
          if (parseInt(this.form.samplerecord.overall_scale) != 0) {
            if (this.form.inspection_mode == 3 || this.form.inspection_mode == 4 || this.form.inspection_mode == 5 || this.form.inspection_mode == 7) {
              isExist = true
            } else if (this.form.inspection_mode == 8) {
              //样本为零 时  将样本为零修改为样本非零 状态
              if (this.form.old_inspection_mode == 3 || this.form.old_inspection_mode == 4 || this.form.old_inspection_mode == 5 || this.form.old_inspection_mode == 7) {
                isExist = true
              }
            }
          }
        }else if(this.form.samplerecord==null && this.form.sample0record == null){
          if (this.form.inspection_mode == 3 || this.form.inspection_mode == 4 || this.form.inspection_mode == 5 || this.form.inspection_mode == 7) {
            isExist = true
          }
        }
        return isExist
      },
      //访谈记录表是否存在
      interviewsrecordIsExist() {
        var isExist = false;
        //只有在样本数量 非零  并且满足 inspection_mode 的情况 才返回true
        if(this.form.samplerecord !=null) {
          if (parseInt(this.form.samplerecord.overall_scale) != 0) {
            if (this.form.inspection_mode == 2 || this.form.inspection_mode == 4 || this.form.inspection_mode == 5 || this.form.inspection_mode == 7) {
              isExist = true
            } else if (this.form.inspection_mode == 8) {
              //样本为零 时  将样本为零修改为样本非零 状态
              if (this.form.old_inspection_mode == 2 || this.form.old_inspection_mode == 4 || this.form.old_inspection_mode == 5 || this.form.old_inspection_mode == 7) {
                isExist = true
              }
            }
          }

        }else if(this.form.samplerecord==null && this.form.sample0record == null){
          if (this.form.inspection_mode == 2 || this.form.inspection_mode == 4 || this.form.inspection_mode == 5 || this.form.inspection_mode == 7) {
            isExist = true
          }
        }
        return isExist
      },
      defectrectificationIsExist() {
        var isExist = false;
        if ((this.form.samplerecord && parseInt(this.form.samplerecord.overall_scale) != 0)|| this.form.walk_through==1 || this.form.defectrectification !=null) {
          if (this.form.design_defect.design_defect_identify == '0' || this.form.execute_defect.execute_defect_identify == '0') {
            isExist = true
          }
        } else if (parseInt(this.form.samplerecord.overall_scale) == 0) {

        }
        return isExist

      },
      sample_size() {
        var sampleCount = 0;
        if(this.form.samplerecord==null) return
        var scale = parseFloat(this.form.samplerecord.overall_scale);
        if (Number.isInteger(scale) && this.form.samplerecord.overall_scale > 0) {
          if (
            this.form.samplerecord.overall_scale >= 1 &&
            this.form.samplerecord.overall_scale <= 5
          ) {
            sampleCount = 1;
          } else if (
            this.form.samplerecord.overall_scale >= 6 &&
            this.form.samplerecord.overall_scale <= 15
          ) {
            sampleCount = 2;
          } else if (
            this.form.samplerecord.overall_scale >= 16 &&
            this.form.samplerecord.overall_scale <= 50
          ) {
            sampleCount = 5;
          } else if (
            this.form.samplerecord.overall_scale >= 51 &&
            this.form.samplerecord.overall_scale <= 200
          ) {
            sampleCount = 15;
          } else {
            sampleCount = 25;
          }
        } else {
          // this.$alert('请输入正整数...','提示')
        }
        return sampleCount;
      },
      // 设计标准分值
      design_standard_score() {
        return this.form.standard_score
          ? (Number(this.form.standard_score) * 0.6).toFixed(2)
          : 0;
      },
      // 设计评价分值
      design_defect_score() {
        return this.form.standard_score &&
        this.form.design_defect.design_defect_prop
          ? (
            (Number(this.form.standard_score) *
            0.6 *
            (100 - parseInt(this.form.design_defect.design_defect_prop))) /
            100
          ).toFixed(2)
          : (this.form.standard_score * 0.6).toFixed(2);
      },
      //执行评价分值
      execute_standard_score() {
        return this.form.standard_score
          ? (Number(this.form.standard_score) * 0.4).toFixed(2)
          : 0;
      },
      execute_defect_score() {
        return this.form.standard_score &&
        this.form.execute_defect.execute_defect_prop
          ? (
            (Number(this.form.standard_score) *
            0.4 *
            (100 - parseInt(this.form.execute_defect.execute_defect_prop))) /
            100
          ).toFixed(2)
          : (this.form.standard_score * 0.4).toFixed(2);
      },
      defect_describe(){
        var design_defect_title_temp = this.form.design_defect.design_defect_title ?this.form.design_defect.design_defect_title:"";
        var execute_defect_title_temp;
        // if(this.form.walk_through>0){
        execute_defect_title_temp=this.form.execute_defect.execute_defect_title? this.form.execute_defect.execute_defect_title:"";
        // }else {
        //   execute_defect_title_temp =this.form.execute_defect.execute_defect_title? this.form.execute_defect.execute_defect_title:this.form.merge_template.summary;
        // }
        return "设计:"+ design_defect_title_temp +"\r执行:"+ execute_defect_title_temp
      }
    },
    mounted() {
      // console.log(this.$router.options)
    },
    created() {
      // "evaluation_state": "1",
      // console.log(this.$route.query)
      //评价计划人员或审核人员标识
      this.evaluator = this.$route.query.evaluator;
      this.sampleState = this.$route.query.sample;//样本为零审核状态
      // alert(this.sampleState);
      if (this.$route.query.bl_evaluator) {
        this.role = 1; //评价人员
      } else if (this.$route.query.bl_auditor) {
        this.role = 2; //审核人员
      }

      //文件上传的辅助信息 ********
      var currentTime = parseInt(
        getNewDate(formatTime(new Date())).getTime() / 1000
      );
      this.headers = {
        token: toFixedBit(
          strToHexCharCode(`${mdSecret}${currentTime}`),
          52,
          true,
          0,
          true
        ),
        timeStamp: currentTime,
        sign: this.MD5(
          `${sessionStorage.getItem("user_name")}${sessionStorage.getItem(
            "token"
          )}${currentTime}`
        )
      };//**************
      //初始化数据
      //获取评价信息
      this.axios
        .get("/api/v1/flow/evaluation/" + this.$route.query.evaplan_id)
        .then(res => {
          if (res.data.code == 0) {
            console.log(res.data);
            //评价计划的基本信息
            this.basicInformation = Object.assign(
              {},
              this.basicInformation,
              res.data.data.info
            );

            //设计缺陷
            var design_defect = {
              design_defect_identify: "1",
              design_defect_score: "",
              design_defect_prop: "0",
              design_defect_title: "健全完整"
            };
            var system_content = [
              {
                name: "",
                content: ""
              }
            ];
            //执行评价缺陷
            var execute_defect = {
              execute_defect_identify: "1", //执行评价缺陷标识 0:有缺陷 1:没有缺陷
              execute_defect_prop: "0", //执行评价扣分比例
              execute_defect_score: "",
              execute_defect_title: "健全完整"
            };
            if(res.data.data.execute_defect && res.data.data.execute_defect.execute_defect_identify =='1'){
              res.data.data.execute_defect.execute_defect_prop ='0';
              res.data.data.execute_defect.execute_defect_title ='健全完整';
            }

            //样本非零 抽样检查表
            var samplerecord = {
              evaluation_id: "",
              list: [],
              numrow: "",
              overall_scale: "",
              sample_size: "",
              samplemethod_id: "",
              sare_id: ""
            };

            //现场检查记录表
            var sceneinspectrecord = {
              scinre_id: "",
              inspect_time: parseInt(new Date().getTime() / 1000),
              inspect_address: "",
              inspect_personnel: "",
              inspect_record: "",
              numrow: ""
            };
            //访谈记录表
            var interviewsrecord = [
              {
                inre_id: "",
                be_interviews_personnel: "",
                be_interviews_position: "",
                be_interviews_job: "",
                interviews_time: parseInt(new Date().getTime() / 1000),
                interviews_address: "",
                interviews_personnel: "",
                record_personnel: "",
                interviews_content: "",
                interviews_record: "",
                numrow: ""
              }
            ];


            res.data.data = Object.assign({}, res.data.data, {
              design_defect:
                res.data.data.design_defect != null
                  ? res.data.data.design_defect
                  : design_defect,
              system_content:
                res.data.data.system_content != null
                  ? res.data.data.system_content
                  : system_content,
              execute_defect:
                res.data.data.execute_defect != null
                  ? res.data.data.execute_defect
                  : execute_defect

            });

            //从后台返回的数据中生成 缺陷类型表现形式的数据
            //********** start********
            var defectrectification = {
              performance_form: "",
              identification_method: "",
              defect_quota: "",
              factor: "",
              defect_property: "1",
              section_id: []
            };

            //将各项数据被选的 集成 defectrectification
            // *************start************
            res.data.data.performance_form.forEach(el => {
              if (el.selected == true) {
                defectrectification.performance_form = el.value
              }
            })
            res.data.data.identification_method.forEach(el => {
              if (el.selected == true) {
                defectrectification.identification_method = el.value
              }
            })
            res.data.data.defect_quota.forEach(el => {
              if (el.selected == true) {
                defectrectification.defect_quota = el.value
              }
            })
            res.data.data.factor.forEach(el => {
              if (el.selected == true) {
                defectrectification.factor = el.value
              }
            })
            defectrectification = Object.assign({}, res.data.data.defectrectification, defectrectification)

            res.data.data = Object.assign({}, res.data.data, {
              defectrectification: defectrectification
            })
            //***************** end *****************

            if (res.data.data.auditing != null) {
              res.data.data.auditing.evaluation_state = res.data.data.auditing.evaluation_state.toString()
            }

            //根据inspection_mode的不同填充不同的数据
            var inspection_mode = res.data.data.inspection_mode;
            if (inspection_mode == 0 || res.data.data.walk_through != 0 ) {
              //使用穿行测试模板

            } else if (inspection_mode == 1) {
              //抽样  最开始评价信息时  都是按照样本非零的数据绑定 结构的
              res.data.data.samplerecord = Object.assign(
                {},
                res.data.data.samplerecord,
                res.data.data.samplerecord != null ? res.data.data.samplerecord : samplerecord
              );
            } else if (inspection_mode == 2) {
              //3.访谈
              if (
                res.data.data.interviewsrecord != null &&
                res.data.data.interviewsrecord.length > 0
              ) {
                res.data.data.interviewsrecord = [
                  ...res.data.data.interviewsrecord
                ];
              } else if (res.data.data.interviewsrecord == null) {
                res.data.data.interviewsrecord = [...interviewsrecord]; //访谈
              }
            } else if (inspection_mode == 3) {
              //2.现场
              res.data.data.sceneinspectrecord = Object.assign(
                {},
                res.data.data.sceneinspectrecord,
                res.data.data.sceneinspectrecord != null ? res.data.data.sceneinspectrecord : sceneinspectrecord
              );
            } else if (inspection_mode == 4) {
              // 1.抽样
              res.data.data.samplerecord = Object.assign(
                {},
                res.data.data.samplerecord,
                res.data.data.samplerecord != null ? res.data.data.samplerecord : samplerecord
              );
              //3.访谈
              if (
                res.data.data.interviewsrecord != null &&
                res.data.data.interviewsrecord.length > 0
              ) {
                res.data.data.interviewsrecord = [
                  ...res.data.data.interviewsrecord
                ];
              } else if (res.data.data.interviewsrecord == null) {
                res.data.data.interviewsrecord = [...interviewsrecord]; //访谈
              }

            } else if (inspection_mode == 5) {
              // 1.抽样
              res.data.data.samplerecord = Object.assign(
                {},
                res.data.data.samplerecord,
                res.data.data.samplerecord != null ? res.data.data.samplerecord : samplerecord
              );
              //2.现场
              res.data.data.sceneinspectrecord = Object.assign(
                {},
                res.data.data.sceneinspectrecord,
                res.data.data.sceneinspectrecord != null ? res.data.data.sceneinspectrecord : sceneinspectrecord
              );
            } else if (inspection_mode == 6) {
              //2.现场
              res.data.data.sceneinspectrecord = Object.assign(
                {},
                res.data.data.sceneinspectrecord,
                res.data.data.sceneinspectrecord != null ? res.data.data.sceneinspectrecord : sceneinspectrecord
              );
              //3.访谈
              if (
                res.data.data.interviewsrecord != null &&
                res.data.data.interviewsrecord.length > 0
              ) {
                res.data.data.interviewsrecord = [
                  ...res.data.data.interviewsrecord
                ];
              } else if (res.data.data.interviewsrecord == null) {
                res.data.data.interviewsrecord = [...interviewsrecord]; //访谈
              }
            } else if (inspection_mode == 7) {
              //抽样 + 现场 + 访谈
              // 1.抽样
              res.data.data.samplerecord = Object.assign(
                {},
                res.data.data.samplerecord,
                res.data.data.samplerecord != null ? res.data.data.samplerecord : samplerecord
              );
              //2.现场
              res.data.data.sceneinspectrecord = Object.assign(
                {},
                res.data.data.sceneinspectrecord,
                res.data.data.sceneinspectrecord != null ? res.data.data.sceneinspectrecord : sceneinspectrecord
              );

              //3.访谈
              if (
                res.data.data.interviewsrecord != null &&
                res.data.data.interviewsrecord.length > 0
              ) {
                res.data.data.interviewsrecord = [
                  ...res.data.data.interviewsrecord
                ];
              } else if (res.data.data.interviewsrecord == null) {
                res.data.data.interviewsrecord = [...interviewsrecord]; //访谈
              }
            } else if (inspection_mode == 8) {
              //样本为零
              this.form.samplerecord.overall_scale = 0
              this.form.sample0record = res.data.data.sample0record
              res.data.data.execute_defect.execute_defect_identify = '1'

              this.form.samplerecord.samplemethod_id = res.data.data.sample0record.samplemethod_id
            }

            //1.样本非零
            if (res.data.data.samplerecord != null) {
              //格式化样本非零  样本 日期格式化 毫秒->日期
              res.data.data.samplerecord.list.forEach(el => {
                el.sample_time = formatDateTime(el.sample_time);
                //模板检查状态
                if (el.inspection_contents && el.inspection_contents.length > 0) {
                  console.log(el)
                  el.inspection_contents.forEach(element => {
                    if (element.state == 0) {
                      element.name = "否";
                    } else if (element.state == 2) {
                      element.name = "不适用";
                    } else {
                      element.name = "是";
                    }
                  });
                }
                if (
                  el.com_inspection_contents &&
                  el.com_inspection_contents.length > 0
                ) {
                  //公司检查状态
                  el.com_inspection_contents.forEach(element => {
                    if (element.state == 0) {
                      element.name = "否";
                    } else if (element.state == 2) {
                      element.name = "不适用";
                    } else {
                      element.name = "是";
                    }
                  });
                }

              });




            } else if (res.data.data.sample0record != null) {
              //2.样本为零  不需要对数据格式化 即没有业务代码

            }

            //格式化现场检查日期  毫秒->日期
            if (res.data.data.sceneinspectrecord != null) {
              res.data.data.sceneinspectrecord.inspect_time = formatDateTime(
                res.data.data.sceneinspectrecord.inspect_time
              );
            }

            //访谈记录表  访谈时间 日期格式化 毫秒->日期
            if (
              res.data.data.interviewsrecord != null &&
              res.data.data.interviewsrecord.length > 0
            ) {
              res.data.data.interviewsrecord.forEach(el => {
                el.interviews_time = formatDateTime(el.interviews_time);
              });
            }

            res.data.data.performance_form.forEach(el => {
              if (el.selected) {
                defectrectification.performance_form = el.value;
              }
            });

            res.data.data.identification_method.forEach(el => {
              if (el.selected) {
                defectrectification.identification_method = el.value;
              }
            });

            res.data.data.defect_quota.forEach(el => {
              if (el.selected) {
                defectrectification.defect_quota = el.value;
              }
            });
            res.data.data.factor.forEach(el => {
              if (el.selected) {
                defectrectification.factor = el.value;
              }
            });

            res.data.data.defect_property.forEach(el => {
              if (el.selected) {
                defectrectification.defect_property = el.value;
              }
            });

            res.data.data.section_list.forEach(el => {
              if (el.selected) {
                defectrectification.section_id.push(el.value);
              }
            });

            console.log(res.data.data);

            //样本为零 未形成记录 审核通过时 此时是有缺陷  即执行缺陷 此时需要有 缺陷类型认定
            if(res.data.data.sample0record && res.data.data.sample0record.sample_0_reason==2 && this.sampleState==1){
              res.data.data.execute_defect.execute_defect_identify = "0"
            }

            this.form = Object.assign({}, this.form, res.data.data);
            console.log(this.form);
          }else {
            this.$alert(res.data.message,"提示").then(()=>{
              this.$router.go(-1)
            })
          }

        });


      //获取公司检查内容
      this.getSampleMaintain().then(res => {
        if (res.data.data.length > 0) {
          //整理（格式化）公司检查内容
          res.data.data.forEach(el => {
            console.log(el);
            this.sampleContentForm.company_samplemaintain.push({
              cosn_id: el.value,
              samplemaintain_desc: el.name
            });
          });
        } else {
          this.sampleContentForm.company_samplemaintain = [];
        }
      });
      console.log(this.form);
    },
    methods: {
      //
      disabledSubmit(){
        this.$message({
          message:"当前评价计划不可更改！！",
          type:'warning'
        })
      },
      //穿行测试 模式 样本总量的确定方法
      mergeSampleTotal(){
        //在穿行测试 样本总量 输入 失去焦点时 请求 样本数量和样本名称的 接口
        var input = Number(this.form.mergerecord.sample_total);
        // reg = /^[1-9]+[0-9]*]*$/;
        //判断输入是否为正整数
        function isInteger(str){
          if(typeof str === 'number' && str%1 === 0){
            return Math.round(str) === str
          }else {
            return false
          }
        }

        if(input>0 && isInteger(input)){
          this.axios.get('/api/v1/flow/mergetemplatemethod',{
            params:{
              merge_template_id:this.form.mergerecord.merge_template_id,
              sample_total:input
            }
          }).then(res=>{
            console.log(res)
            if(res.data.code==0){
              this.form.mergerecord.sample_size = res.data.data.sample_size;
            }
            console.log(this.form.mergerecord.sample_size)

          })
        }else {
          this.$alert('请输入正整数','提示').then(()=>{
            this.form.mergerecord.sample_total = ''
          })
        }


      },
      //本地消息推送
      putMessage(total_messages){
        this.axios.post('/api/v1/accout/usermessagebatch',
          {
            total_messages:total_messages
          },
        ).then(res=>{
          if(res.data.code==0){
//              this.$alert(res.data.message,'提示',function () {
//                this.$router.push({
//                  path:'/progressTest'
//                })
//              })
          }
        }).then((res)=>{

        }).catch((err)=>{
          this.$alert(err.message,'错误');
        })
      },
      //oa消息推送
      putOAMessage(total_messages){
        this.axios.post('/api/v1/accout/externalmessagebatch',{
          total_messages:total_messages
        }).then((res)=>{
          console.log(res.data)
        })
      },

      //每次关闭制度内容复制弹窗 清空数据
      closeContentForm(){
        console.log(123)
        this.contentForm ={
          tableData:[],
          dacate_id:'',
          search_txt:''
        }
      },
      searchContentByDacate_id(){
        this.axios.get('/api/v1/flow/controlregime/'+this.form.evaplan_id +'?dacate_id='+ this.contentForm.dacate_id).then(res=>{
          console.log(res)
          if(res.data.code==0){
            this.contentForm.tableData = res.data.data;
          }
        })
      },
      searchContentBySearch_txt(){
        console.log(this.contentForm.search_txt)
        this.axios.get('/api/v1/flow/controlregime/'+this.form.evaplan_id +'?search='+ this.contentForm.search_txt).then(res=>{
          console.log(res)
          if(res.data.code==0){
            this.contentForm.tableData = res.data.data;
          }
        })
      },

      copyContent(){
        //在评价人员  保存或者 提交时有效
        if((this.form.evaluation_state ==0 || this.form.evaluation_state ==1)|| this.role==1){
          this.getClassificationList()
          this.axios.get('/api/v1/flow/controlregime/'+this.form.evaplan_id).then(res=>{
            if(res.data.code==0){
              this.contentForm.tableData = res.data.data;
            }
          })
          this.walk_through_Identification = true;
        }
      },
      //删除设计评价的制度内容
      deleteSystemContent(index) {
        this.form.system_content.splice(index, 1)
      },
      //设计评价缺陷标识改变
      designDefectIdentifyChange(label) {
        if (label == 1) {
          this.form.design_defect.design_defect_prop = 0;
          this.form.design_defect.design_defect_title = "健全完整";
        } else if (label == 0) {
          this.form.design_defect.design_defect_title = "";
        }
      },
      //设执行评价缺陷标识改变
      executeDefectIdentifyChange(label) {
        if (label == 1) {
          this.form.execute_defect.execute_defect_prop = 0;
          this.form.execute_defect.execute_defect_title = "健全完整";
        } else if (label == 0) {
          this.form.execute_defect.execute_defect_prop = 0;
          this.form.execute_defect.execute_defect_title = " ";
        }
      },
      //文件上传
      uploadSuccess(response, file, fileList, index) {
        console.log(index);
        console.log(response);
        if (response.code == 0) {
          this.$alert(response.message, "提示");
          if(this.form.walk_through==0){
            this.form.samplerecord.list[index].file_id = response.data.file_id;
            this.form.samplerecord.list[index].attachment_link =
              response.data.file_path;
            this.form.samplerecord.list[index].file_name = response.data.file_name;
          }else{
            this.form.mergerecord.list[index].file_id = response.data.file_id;
            this.form.mergerecord.list[index].mere_data_link = response.data.file_path;
          }

        }

      },
      viewBasicInformation() {
        var start,end;
        start = formatTimeIncludeText(
          this.basicInformation.evaluation_starttime + "000"
        );
        end = formatTimeIncludeText(
          this.basicInformation.evaluation_endtime + "000"
        );
        this.basicInformation.duringEvaluation = start + "-" + end;

        //function -> formatTimeIncludeText  将时间戳转化为  xxxx年xx月xx日
        this.basicInformation.evaluation_finishtime = formatTimeIncludeText(
          this.basicInformation.evaluation_finishtime + "000"
        );
        this.basicInformation.current_time = formatTimeIncludeText(
          this.basicInformation.current_time + "000"
        );

        this.basicInformation.auditing_current_time = formatTimeIncludeText(
          this.basicInformation.auditing_current_time + "000"
        );

        this.showBasicInformation = true;
      },
      //提交样本为零去审核
      onSubmitSample0Record(formName) {
        // 样本为零数据的提交  =》 submit_type: "2"
        var data = {
          evaplan_id: "",
          system_content: [],
          design_defect: {
            design_defect_identify: "1",
            design_defect_score: "",
            design_defect_prop: "",
            design_defect_title: ""
          },
          sample0record: {
            samplemethod_id: "",
            overall_scale: 0,
            sample_0_size: 0,
            sample_0_reason: "",
            no_record_reason: "",
            should_form_sample_name: ""
          }
        };
        // console.log(this.form);
        for (var i in data) {
          data[i] = this.form[i];
        }
        data.design_defect.design_defect_score = this.design_defect_score; //
        data.sample0record.should_form_sample_name = this.form.should_form_sample_name;
        data = Object.assign(
          {},
          {...data},
          {
            submit_type: "2"
          }
        );
        this.axios.post("/api/v1/flow/evaluation", data).then(res => {
          if(res.data.code==0){
            //样本为零数据提交 给 样本为零审核的人员发送消息 （主管） === start ===
            this.totalMessage[0]={
              mess_receiver:this.form.info.auditor_id,
              mess_type:6,
              mess_link:'/progressTest?evaluationplanTypeId='+this.form.info.evaplan_type_id+"&evaluationplanTypeName="+this.form.info.evaplan_type_name
            };
            this.totalOaMessage[0]={
              mess_receiver:(this.form.info.auditor_name),
              mess_type:6,
              mess_link:'/progressTest?evaluationplanTypeId='+this.form.info.evaplan_type_id+"&evaluationplanTypeName="+this.form.info.evaplan_type_name
            };
            this.putMessage(this.totalMessage);
            this.putOAMessage(this.totalOaMessage);
            // === end ===

            this.$alert(res.data.message, "提示").then(() => {
              this.$router.go(-1);
            })
          }else{
            this.$alert(res.data.message,'提示')
          }


        });
        // this.$refs[formName].validate(valid => {
        //
        //   if (valid) {
        //
        //   }
        // });
      },
      //表现形式的切换
      performanceFormChange() {
        // 点击之前先让数据还原
        this.form.identification_method.forEach(el => {
          el.selected = false;
        });
        this.form.defect_quota.forEach(el => {
          el.selected = false;
        });

        this.form.defectrectification.identification_method = "";
        this.form.defectrectification.defect_quota = "";

        console.log(this.form.defectrectification.performance_form);
        if (this.form.defectrectification.performance_form == 1) {
          this.form.identification_method.forEach((el, index) => {
            // console.log(el + "--------" + index);
            if (index != 0) {
              el.selected = true;
            }
          });
          this.form.defect_quota.forEach((el, index) => {
            if (index != 2) {
              el.selected = true;
            }
            // console.log(JSON.stringify(el) + "--------" + index);
          });
        } else if (this.form.performance_form == 2) {
          this.form.identification_method.forEach((el, index) => {
            // console.log(el + "--------" + index);
            el.selected = false;
          });
          // this.form.defect_quota = 3;
          this.form.defect_quota.forEach((el, index) => {
            // console.log(JSON.stringify(el) +"--------"+index)
            el.selected = false;
            // console.log(JSON.stringify(el) + "--------" + index);
          });
        }

        console.log(this.form);
      },
      //认定方式切换
      identificationMethodChange() {
        console.log(this.form.defectrectification.identification_method);
        // 点击之前先让数据还原
        this.form.defect_quota.forEach(el => {
          el.selected = false;
        });

        if (this.form.defectrectification.identification_method == 1) {
          this.form.defect_quota.forEach((el, index) => {
            // console.log(JSON.stringify(el) +"--------"+index)
            if (index != 2) {
              el.selected = true;
            }
            // console.log(JSON.stringify(el) + "--------" + index);
          });
        } else if (this.form.defectrectification.identification_method == 2) {
          this.form.defect_quota.forEach((el, index) => {
            // console.log(JSON.stringify(el) +"--------"+index)
            if (index == 2) {
              el.selected = true;
            }
            // console.log(JSON.stringify(el) + "--------" + index);
          });
        }
      },
      //因素改变切换 缺陷类型
      factorChange() {
        console.log(this.form.defectrectification.factor);
        this.form.defect_property.forEach(el => {
          if (el.value == this.form.defectrectification.factor) {
            this.form.defectrectification.defect_property = el.value;
          }
        });
        // this.form.defect_property = this.form.factor
      },
      //删除检查内容的每一项
      deleteCheckItem(index) {
        this.$confirm("确定删除此检查内容吗？", "确认删除", {
          distinguishCancelAndClose: true,
          confirmButtonText: "删除",
          cancelButtonText: "放弃"
        })
          .then(() => {
            //删除数组被删除的项
            console.log(index);
            this.axios
              .delete("/api/v1/flow/companysamplemaintain/" + index)
              .then(res => {
                console.log(res);
                //获取公司检查列表
                this.getSampleMaintain()
                  .then(resp => {
                    // console.log('dfashjfh ahfahf')
                    console.log(resp);
                    if (resp.data.data.length > 0) {
                      resp.data.data.forEach(el => {
                        console.log(el);
                        this.sampleContentForm.company_samplemaintain.push({
                          cosn_id: el.value,
                          samplemaintain_desc: el.name
                        });
                      });
                    } else {
                      this.sampleContentForm.company_samplemaintain = [];
                    }

                    this.form.company_samplemaintain = resp.data.data.reverse();
                  })
                  .then(() => {
                    this.$message({
                      type: "info",
                      message: "删除成功"
                    });
                  });
              });
          })
          .catch(action => {
            // this.$message({
            //   type: 'info',
            //   message:''
            // })
          });
      },
      //添加公司检查内容
      addCleckItem() {
        this.sampleContentForm.company_samplemaintain.push({
          cosn_id: "",
          samplemaintain_desc: ""
        });
      },
      //修改样本总量
      overallScaleBlur() {
        if (!isNaN(this.form.samplerecord.overall_scale)) {

          var scale = parseFloat(this.form.samplerecord.overall_scale);

          //样本非零
          if (scale != 0) {
            if (!Number.isInteger(scale)) {
              this.$alert("请输入正整数...", "提示");
            }
            //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX START//
            //当样本为零 审核不通过 重新做评价计划的 改为样本非零  时候  inspection_mode  -> old_inspection_mode ?
            if (this.form.inspection_mode == 8) {
              // 重新组装 样本非零的数据

              //现场检查记录表
              var sceneinspectrecord = {
                scinre_id: "",
                inspect_time: parseInt(new Date().getTime()),
                inspect_address: "",
                inspect_personnel: "",
                inspect_record: "",
                numrow: ""
              };
              //访谈记录表
              var interviewsrecord = [
                {
                  inre_id: "",
                  be_interviews_personnel: "",
                  be_interviews_position: "",
                  be_interviews_job: "",
                  interviews_time: parseInt(new Date().getTime()),
                  interviews_address: "",
                  interviews_personnel: "",
                  record_personnel: "",
                  interviews_content: "",
                  interviews_record: "",
                  numrow: ""
                }
              ];

              var inspection_mode = this.form.old_inspection_mode

              if (inspection_mode == 1) {
                //抽样

              } else if (inspection_mode == 2) {
                //访谈
                this.$set(this.form, 'interviewsrecord', interviewsrecord)
                // this.form.interviewsrecord = interviewsrecord;
              } else if (inspection_mode == 3) {
                //现场
                this.$set(this.form, 'sceneinspectrecord', sceneinspectrecord)
              } else if (inspection_mode == 4) {
                //访谈
                this.$set(this.form, 'interviewsrecord', interviewsrecord)

              } else if (inspection_mode == 5) {
                //现场
                this.$set(this.form, 'sceneinspectrecord', sceneinspectrecord)
              } else if (inspection_mode == 6) {
                //现场  访谈
                this.$set(this.form, 'sceneinspectrecord', sceneinspectrecord)
                this.$set(this.form, 'interviewsrecord', interviewsrecord)
              } else if (inspection_mode == 7) {
                //抽样 + 现场 + 访谈
                // this.form.sceneinspectrecord = sceneinspectrecord;
                this.$set(this.form, 'sceneinspectrecord', sceneinspectrecord)
                this.$set(this.form, 'interviewsrecord', interviewsrecord)
                // this.form.interviewsrecord = interviewsrecord;
              }
            }
            //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX END//

            // 有样本数量时添加样本表格
            var inspection_contents_temp = []; //created
            this.form.samplemaintain.forEach(el => {
              var t = {
                id: el.value,
                state: "1"
              };
              inspection_contents_temp.push({...t});
            });

            var com_inspection_contents_temp = []; //来自公司检查列表

            //获取公司检查列表
            this.getSampleMaintain()
              .then(res => {
                console.log(res);
                if (res.data.data.length > 0) {
                  res.data.data.forEach(el => {
                    this.sampleContentForm.company_samplemaintain.push({
                      cosn_id: el.value,
                      samplemaintain_desc: el.name
                    });
                    this.form.company_samplemaintain = res.data.data;
                    res.data.data.forEach(el => {
                      com_inspection_contents_temp.push({
                        id: el.value,
                        state: "1"
                      });
                    });
                  });
                }
              })
              .then(res => {
                var sampleList = {
                  saco_id: "",
                  sample_time: "",
                  sample_name: "",
                  inspection_contents: [...inspection_contents_temp],
                  com_inspection_contents: [...com_inspection_contents_temp],
                  inspection_conclusion: "",
                  attachment_link: "",
                  file_id: "",
                  file_name: ""
                };
                var samplerecord_temp = {
                  list: []
                };

                //通过样本总量 及计算方法确定  抽样数量 然后再确定 添加样本的数量 -》生成样本表格数据
                for (var i = 0; i < this.sample_size; i++) {
                  //这里牵扯到一个对象的深拷贝，要是直接push sampleList 的话 数据只想同一个地址，会使每个样本的数据一样
                  samplerecord_temp.list.push(
                    JSON.parse(JSON.stringify(sampleList))
                  );
                }
                samplerecord_temp.list.forEach(el => {
                  console.log(el);
                  //模板检查状态
                  el.inspection_contents.forEach(element => {
                    if (element.state == 0) {
                      element.name = "否";
                    } else if (element.state == 2) {
                      element.name = "不适用";
                    } else {
                      element.name = "是";
                    }
                  });
                  //公司检查状态
                  el.com_inspection_contents.forEach(element => {
                    if (element.state == 0) {
                      element.name = "否";
                    } else if (element.state == 2) {
                      element.name = "不适用";
                    } else {
                      element.name = "是";
                    }
                  });
                });
                console.log(this.form.samplerecord);
                this.form.samplerecord = Object.assign(
                  {},
                  this.form.samplerecord,
                  samplerecord_temp
                ); //导致后边修改总量时 覆盖了被修改的  list不会变
              });


          } else {
            //样本为零
            this.$set(this.form, "sample0record", {
              samplemethod_id: this.form.samplerecord.samplemethod_id,
              overall_scale: 0,
              sample_0_size: 0,
              sample_0_reason: "1",
              no_record_reason: "",
              should_form_sample_name: ""
            });

          }

          console.log(this.form);
        }
      },
      //删除样本
      deleteSampleItem(index) {
        this.form.samplerecord.list.splice(index, 1); //删除当前项，此时原来数据已更新
        // console.log(this.form.samplerecord.list)
      },
      // 添加访谈记录
      addInterviewNotes() {
        this.form.interviewsrecord.push({
          inre_id: "",
          be_interviews_personnel: "",
          be_interviews_position: "",
          be_interviews_job: "",
          interviews_time: parseInt(new Date().getTime()),
          interviews_address: "",
          interviews_personnel: "",
          record_personnel: "",
          interviews_content: "",
          interviews_record: "",
          numrow: ""
        });
      },
      //删除访谈记录
      deleteInterviewsrecord(index) {
        this.form.interviewsrecord.splice(index, 1)
      },
      // 添加设计评论
      addDesignContent() {
        this.form.system_content.push({
          name: "",
          content: ""
        });
      },
      //添加样本
      addSample() {
        var temp = {};
        // 添加列内容 复制每行字段
        console.log(this.form);
        for (var i in this.form.samplerecord.list[0]) {
          temp[i] = "";
          if (
            i == "com_inspection_contents" &&
            !!this.form.samplerecord.list[0].com_inspection_contents
          ) {
            temp[i] = [];
            this.form.samplerecord.list[0].com_inspection_contents.forEach(el => {
              temp.com_inspection_contents.push({
                id: "",
                name: "是",
                state: "1"
              });
            });
          }

          if (i == "inspection_contents") {
            temp[i] = [];
            this.form.samplerecord.list[0].inspection_contents.forEach(el => {
              temp.inspection_contents.push({
                id: "",
                name: "是",
                state: "1"
              });
            });
          }
        }

        this.form.samplerecord.list.push(temp);
      },
      //点击 添加检查内容按钮
      addSampleMaintain() {
        console.log(this.$route.query.evaplan_id);
        //点击 添加检查内容
        this.addSampleContent = true;
      },
      //获取公司检查内容列表
      getSampleMaintain() {
        this.sampleContentForm.company_samplemaintain = []; //先清空 公司列表信息
        return this.axios.get(
          "/api/v1/flow/companysamplemaintain/" + this.$route.query.evaplan_id
        );
      },
      cancelSampleContentAdd() {
        this.addSampleContent = false;
      },
      //提交公司检查内容列表
      sureSampleContentAdd(formName) {
        this.$refs[formName].validate(valid => {
          if (valid) {
            var data = [];
            console.log(this.sampleContentForm.company_samplemaintain);
            if (this.sampleContentForm.company_samplemaintain) {
              this.sampleContentForm.company_samplemaintain.forEach(el => {
                console.log(el);
                //将公司检查内容整理  提交前的准备
                if (el.cosn_id == "") {
                  //添加的部分
                  data.push({
                    evaplan_id: this.$route.query.evaplan_id,
                    samplemaintain_desc: el.samplemaintain_desc
                  });
                } else {
                  //修改检查内容
                  data.push(el);
                }
              });
            }

            this.axios
              .post("/api/v1/flow/companysamplemaintain", {
                company_samplemaintain: data
              })
              .then(res => {
                console.log(res);
                //获取公司检查列表
                this.getSampleMaintain().then(resp => {
                  console.log(resp.data.data);
                  if (resp.data.data.length > 0) {
                    resp.data.data.forEach(el => {
                      this.sampleContentForm.company_samplemaintain.push({
                        cosn_id: el.value,
                        samplemaintain_desc: el.name
                      });
                      this.form.company_samplemaintain = resp.data.data;
                    });
                    // name: "goog"
                    // numrow: "1"
                    // value: "105"
                    var com_inspection_contents_temp = [];
                    resp.data.data.forEach(el => {
                      com_inspection_contents_temp.push({
                        id: el.value,
                        state: "1"
                      });
                    });
                    this.form.samplerecord.list.forEach(el => {
                      el.com_inspection_contents = [
                        ...com_inspection_contents_temp
                      ];
                      el.com_inspection_contents.forEach(element => {
                        if (element.state == 0) {
                          element.name = "否";
                        } else if (element.state == 2) {
                          element.name = "不适用";
                        } else {
                          element.name = "是";
                        }
                      });
                    });
                  }
                });
              });

            this.addSampleContent = false; //公司内容评价内容列表展开和隐藏的标识
            //填充公司检查内容
          } else {
            this.$alert("检查内容不能为空", "提示");
            return false;
          }
        });
      },
      //提交所有数据
      onSubmitEvaluate(formName, type) {
        /**
         * 0 保存
         * 1 提交评价信息（正常的评价信息提交，也包括样本为零信息审核通过后的评价信息提交）
         * 2 提价样本为0信息(仅仅是提交样本为零数据审核)
         * 3提交评价审核
         * */
        console.log(this.form);
        //1.评价人员 保存评价信息
        if (type.submit_type == 0) {
          // A .非穿行测试数据的处理
          if (this.form.walk_through == 0) {
            //保存不需要校验 但是需要对数据格式化
            if (this.form.samplerecord != null) {
              //将抽样数据的时间改为毫秒值
              if (this.form.samplerecord.list && this.form.samplerecord.list.length > 0) {
                this.form.samplerecord.list.forEach(el => {
                  el.sample_time = parseInt(
                    new Date(el.sample_time).getTime() / 1000
                  );
                });
              }
            }
            if (this.form.sceneinspectrecord != null) {
              //将现场检查时间改为毫秒值
              this.form.sceneinspectrecord.inspect_time = parseInt(
                new Date(this.form.sceneinspectrecord.inspect_time).getTime() / 1000
              );
            }
            if (this.form.interviewsrecord && this.form.interviewsrecord.length > 0) {
              //将访谈检查时间改为毫秒值
              this.form.interviewsrecord.forEach(el => {
                el.interviews_time = parseInt(
                  new Date(el.interviews_time).getTime() / 1000
                );
              });
            }

            this.form.samplerecord = Object.assign({}, this.form.samplerecord, {
              sample_size: this.sample_size
            });

            if (this.form.samplerecord && this.form.samplerecord.overall_scale == 0) {
              this.form.samplerecord = null;
              this.form.sample0record ={};
              this.form.sample0record.overall_scale = 0;
              this.form.sample0record.samplemethod_id = this.form.samplerecord.samplemethod_id;
              this.form.sample0record.sample_0_size = 0;
            } else {
              this.form.sample0record = null;
            }

          }else{
            // B.穿行测试模式下 保存穿心测试的数据
            // var arrtemp =['sample_1','sample_2','sample_3','sample_4','sample_5'];
            // this.merge_template_sample_list.forEach((el,index)=>{
            //   this.form.mergerecord[arrtemp[index]] = el
            // })
            // console.log(this.form.mergerecord)
          }

          this.form.design_defect.design_defect_score = this.design_defect_score; //设计评价分值（计算属性）
          this.form.execute_defect.execute_defect_score = this.execute_defect_score; //执行评价分值（计算属性）

          var data = Object.assign(
            {
              submit_type: type.submit_type
            },
            this.form,
            {}
          );
          // 此处是将公司的责任部门["44", "43"]=> 43,44
          data.defectrectification.section_id = data.defectrectification.section_id.join();
          console.log(data)

          //保存不需要校验
          this.axios.post("/api/v1/flow/evaluation", data).then(res => {
            console.log(res.data);
            this.$alert(res.data.message, "提示");
          });


          //2.评价人员提交 评价信息
        } else if (type.submit_type == 1) {

          //提交要校验表单
          this.$refs[formName].validate(valid => {
            console.log(this.form)
            // A .非穿行测试
            if(this.form.walk_through==0){
              if (this.form.samplerecord != null &&this.form.samplerecord.overall_scale !=0 ) {
                //将抽样数据的时间改为毫秒值
                if (this.form.samplerecord.list && this.form.samplerecord.list.length > 0) {
                  this.form.samplerecord.list.forEach(el => {
                    el.sample_time = parseInt(
                      new Date(el.sample_time).getTime() / 1000
                    );
                  });
                }
              }

              if (this.form.sceneinspectrecord != null) {
                //将现场检查时间改为毫秒值
                this.form.sceneinspectrecord.inspect_time = parseInt(
                  new Date(this.form.sceneinspectrecord.inspect_time).getTime() /
                  1000
                );
              }

              if (this.form.interviewsrecord != null) {
                //将访谈检查时间改为毫秒值
                this.form.interviewsrecord.forEach(el => {
                  el.interviews_time = parseInt(
                    new Date(el.interviews_time).getTime() / 1000
                  );
                });
              }
              this.form.samplerecord = Object.assign({}, this.form.samplerecord, {
                sample_size: this.sample_size
              });

              //页面是都是按照样本非零的数据绑定的，没有样本为零的数据 样本为零的数据都是组成的
              if (this.form.samplerecord && this.form.samplerecord.overall_scale == 0) {
                this.form.sample0record.overall_scale = 0;
                this.form.sample0record.samplemethod_id = this.form.samplerecord.samplemethod_id;
                this.form.sample0record.sample_0_size = 0;
                this.form.samplerecord = null;
              } else {
                //样本为零 审核不通过时 改为样本 非零 时 需将 样本为零 置为null
                this.form.sample0record = null
              }
              //穿行测试 数据 结尾
            }else{
              this.form.samplerecord = null;
              this.form.sample0record = null;
            }




            this.form.design_defect.design_defect_score = this.design_defect_score; //设计评价分值（计算属性）
            this.form.execute_defect.execute_defect_score = this.execute_defect_score; //执行评价分值（计算属性）

            var data = Object.assign(
              {
                submit_type: type.submit_type
              },
              this.form,
              {}
            );

            // 此处是将公司的责任部门["44", "43"]=> 43,44
            data.defectrectification.section_id = data.defectrectification.section_id.join();
            console.log(data)

            if (valid) {
              this.axios.post("/api/v1/flow/evaluation", data).then(res => {
                if (res.data.code == 0) {
                  //评价人员评价任务完成后 给对应的审核人员发送消息提醒  **** start ****
                  this.totalMessage[0]={
                    mess_receiver:this.form.info.auditor_id,
                    mess_type:1,
                    mess_link:'/progressTest?evaluationplanTypeId='+this.form.info.evaplan_type_id+"&evaluationplanTypeName="+this.form.info.evaplan_type_name
                  };
                  this.totalOaMessage[0]={
                    mess_receiver:(this.form.info.auditor_name),
                    mess_type:1,
                    mess_link:'/progressTest?evaluationplanTypeId='+this.form.info.evaplan_type_id+"&evaluationplanTypeName="+this.form.info.evaplan_type_name
                  }
                  this.putMessage(this.totalMessage);
                  this.putOAMessage(this.totalOaMessage);
                  this.$router.go(-1);
                  // **** end ****
                } else {
                  this.$alert('提交数据出现了问题...', '提示');
                }
              });
            } else {
              this.$alert('表单数据填写有误，请认真核查后再提交...', '提示');
              return false;
            }
          });

          // 审核人员审核数据提交
        }
        else if (type.submit_type == 3) {
          var that = this;
          //审核人员审核
          this.$refs[formName].validate(valid => {
            if (valid) {
              this.axios
                .post("/api/v1/flow/evaluationauditing", {
                  auditing: this.form.auditing
                }).then((res)=>{
                console.log(res)
                if(res.data.code==0) {

                  //审核标识为通过时，才提交图片 =》保存评价底稿
                  if ( this.form.auditing.evaluation_state == 2 ) {
                    //审核的时候将检查表生成图片
                    let that = this;
                    html2canvas(document.querySelector('.convertToImage'), {async: false}).then(function (canvas) {
                      return new Promise((resolve, reject) => {
                        that.src = canvas.toDataURL("image/png");
                        resolve(that.src)
                      })
                    }).then((src)=>{
                      that.axios.post('/api/v1/flow/evaplandraft', {
                        evaplan_id: that.form.evaplan_id,
                        draft_name: that.src
                      }).then(response => {
                        //提交成功返回 图片也生成 跳转流程测试页面
                        if (response.data.code == 0) {
                          that.$alert("提交成功", "提示").then(() => {
                            that.$router.back();
                          })
                        }
                      })
                    })


                  }else {
                    //当审核有缺陷是不保存图片
                    this.$alert(res.data.message,"提示").then(res=>{
                      this.$router.go(-1);
                    })
                  }
                }else {
                  this.$alert(res.data.message,"提示")
                }

              });

            } else {
              this.$alert("表单数据填写有问题","提示");
              return false;
            }
          });
        }
      },
      //资料列表
      getClassificationList() {
        //这里只是显示的 分类
        this.axios.get('/api/v1/build/datumquery?is_show=close').then(res => {
          console.log(res.data.data)
          /**
           * var all = {
            dacate_id: "all",
            dacate_num: "",
            dacate_name: "所有",
            dacate_desc: "所有",
            dacate_pid: "",
            dacate_level: "",
            dacate_state: "",
            current_time: "",
            numrow: "",
            son_dacate: []
          }* */

          if (res.data.code == 0 && res.data.data.length>0 ) {
            this.classificationList = [...res.data.data];
          }
          console.log(this.classificationList)
        })
      }

    }
  };
</script>
<style scoped>
  .defineIndex {
    padding: 10px;
    box-sizing: border-box;
  }

  .defineIndex .e-con-h3 {
    font-size: 20px;
    text-align: center;
    color: #000;
    font-weight: bold;
    height: 58px;
    line-height: 58px;
    margin-bottom: 20px;
  }

  .defineIndex .see-info {
    color: #666;
    font-size: 14px;
    font-weight: 400;
    margin-left: 12px;
    cursor: pointer;
  }

  .basic-information-content {
    color: #666;
    font-size: 14px;
    line-height: 2.4em;
  }

  .loading{
    line-height: 5em;
    font-size: 14px;
    color:#444;
    text-align: center;
  }

  .defineIndex .e-con-form {
    width: 1200px;
    max-width: 1200px;
    margin: 0 auto;
  }
  .defineIndex .el-table >>> th.is-leaf {
    background: #d3e9bb;
    height: 58px;
  }

  /* 内容部分的common */

  .defineIndex .evaluate-content {
    margin-bottom: 16px;
    padding: 15px 20px 48px;
    box-sizing: border-box;
    background: #f3f9ed;
  }

  .evaluate-content-title {
    margin-bottom: 24px;
    font-size: 20px;
    color: #5d9120;
    font-weight: 400;
  }

  .evaluate-content-title > span {
    margin-right: 10px;
    padding-left: 8px;
    padding-right: 8px;
    box-sizing: border-box;
    border-radius: 4px;
    background: #8bc34a;
    line-height: 24px;
    color: #fff;
    text-align: center;
  }

  /* 设计评价 */

  .design-evaluate {
    margin-bottom: 16px;
  }

  .design-content {
    padding-top: 4px;
    padding-bottom: 4px;
    box-sizing: border-box;
    background: #e8f3dc;
    border-bottom: 1px solid #fff;
  }

  .design-evaluate-item {
    margin-bottom: 16px;
  }

  .add-design-content {
    width: 100%;
  }

  .el-dialog .content_form .el-input{
    width:auto;
  }

  .defineIndex  >>>.el-dialog .content_form .el-select .el-input{
    width:auto;
  }

  /* 执行评价 */

  .execute-evaluate {
  }

  .execute-evaluate-item {
    margin-bottom: 20px;
    background: #e8f3dc;
  }

  .execute-evaluate-item-thead {
    margin-bottom: 18px;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 16px;
    box-sizing: border-box;
    background: #cce5b0;
    color: #5d9120;
    font-weight: 400;
  }

  .execute-evaluate-item-body {
    position: relative;
    margin-bottom: 10px;
    padding: 0 15px 20px;
    box-sizing: border-box;
  }

  .execute-evaluate-item-body-mask {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    background: transparent;
  }

  .execute-evaluate-item-thead button {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .defineIndex
  >>> .execute-evaluate-item
  .el-table
  .el-table__header-wrapper
  .has-gutter
  tr,
  .defineIndex
  >>> .execute-evaluate-item
  .el-table
  .el-table__header-wrapper
  .has-gutter
  th {
    background: #d5e9bf;
    color: #5d9120;
    font-size: 16px;
  }

  .form-content {
    position: relative;
  }

  .form-content .form-content-mask {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: transparent;
    z-index: 999;
  }

  /*审核标识*/
  .audit-identification {
    padding: 15px 20px 30px;
    box-sizing: border-box;
    background: #f1f5fb;
  }

  /* 底部提交按钮 */

  .defineIndex .e-form-submit {
    margin-top: 60px;
  }

  .defineIndex .defect-audit {
    text-align: center;
    padding-bottom: 120px;
  }
</style>
